<#import "/spring.ftl" as spring />
<html>
<head>

</head>
<body>

<div id="content">

	<h1>INVOICES</h1>

	<p><a href="initiateInvoicePayment.html">pay outstanding invoices</a></p>
	<table>
	<tr>
		<th>Month</th>
		<th>Amount</th>
		<th>Payment Status</th>
	</tr>
	<#list invoices as invoice>
		<tr>
			<td><a href="invoiceDetail.html?id=${invoice.id}" />${invoice.invoicePeriodStartDate?string("MMMM yyyy")}</a></td>
			<td>$${invoice.calculateInvoiceAmount()}</td>
			<#if paidInvoices?seq_contains(invoice)>
				<td>PAID</td>
			<#else>
				<td>NOT PAID</td>
			</#if>			
		</tr>
	</#list>
	<#if invoices?size = 0>
		<tr>
			<td colspan="2"><i>You have no invoices yet.  Our booking fee only applies to inspections booked by customers using a web browser.</i></td>
		</tr>
	</#if>
	
	</table>
	
</div>

</body>
</html>
